import { Link, useSearchParams } from "react-router-dom"

const Login = () => {
    // 获取login组件通过传递过来的参数   searchParams传参
    const [params]=useSearchParams()
    const id=params.get('id')
    const name=params.get('name')
    return <>
        <div class='login'>这是login组件
            {/* 声明式导航 */}
            <Link to='/article'>跳转到文章页</Link>
            <Link to='/article/1001'>params传参</Link>
            <div>
                <span>article组件传递过来的参数：</span>
                <span>id:{id}</span>
                <span>name:{name}</span>
            </div>
        </div>
    </>
}
export default Login